package developer.zyk.starter.controllers.knowledge.vo;

import developer.zyk.ability.knowledge.bo.OperateRecord;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author zhangyongkang
 * @time 2025/5/14 17:36
 * @description
 */
@Data
public class ChatKnowledgeVO implements Serializable {
    private Long id;
    private String fileName;
    private String title;
    private String contentPrefix;
    private String url;
    private String path;
    private Long fileId;
    private Integer enable;
    private LocalDateTime modifyTime;
    private String createBy;

    private String status;
    private String statusText;
    private List<OperateRecord> operateList;

    private Permission permission;

    @Data
    public static class Permission {
        private boolean enablePreview;
        private boolean enableAiBtn;
        private boolean enableLoad;
        private boolean enableDeleted;

        public static Permission of(boolean preview, boolean aibtn, boolean load, boolean enableDeleted) {
            Permission res = new Permission();
            res.setEnablePreview(preview);
            res.setEnableAiBtn(aibtn);
            res.setEnableLoad(load);
            res.setEnableDeleted(enableDeleted);
            return res;
        }
    }
}
